\(\int \cos (e+f x) (a+b \sec ^2(e+f x))^p \, dx\) [301]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (warning: unable to verify)
   Maple [F]
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 21, antiderivative size = 101 \[ \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\frac {\operatorname {AppellF1}\left (\frac {1}{2},p,-p,\frac {3}{2},\sin ^2(e+f x),\frac {a \sin ^2(e+f x)}{a+b}\right ) \cos ^2(e+f x)^p \sin (e+f x) \left (\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )\right )^p \left (1-\frac {a \sin ^2(e+f x)}{a+b}\right )^{-p}}{f} \]

[Out]

AppellF1(1/2,p,-p,3/2,sin(f*x+e)^2,a*sin(f*x+e)^2/(a+b))*(cos(f*x+e)^2)^p*sin(f*x+e)*(sec(f*x+e)^2*(a+b-a*sin(
f*x+e)^2))^p/f/((1-a*sin(f*x+e)^2/(a+b))^p)

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {4233, 1985, 1986, 441, 440} \[ \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\frac {\sin (e+f x) \cos ^2(e+f x)^p \left (1-\frac {a \sin ^2(e+f x)}{a+b}\right )^{-p} \operatorname {AppellF1}\left (\frac {1}{2},p,-p,\frac {3}{2},\sin ^2(e+f x),\frac {a \sin ^2(e+f x)}{a+b}\right ) \left (\sec ^2(e+f x) \left (-a \sin ^2(e+f x)+a+b\right )\right )^p}{f} \]

[In]

Int[Cos[e + f*x]*(a + b*Sec[e + f*x]^2)^p,x]

[Out]

(AppellF1[1/2, p, -p, 3/2, Sin[e + f*x]^2, (a*Sin[e + f*x]^2)/(a + b)]*(Cos[e + f*x]^2)^p*Sin[e + f*x]*(Sec[e
+ f*x]^2*(a + b - a*Sin[e + f*x]^2))^p)/(f*(1 - (a*Sin[e + f*x]^2)/(a + b))^p)

Rule 440

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[a^p*c^q*x*AppellF1[1/n, -p,
 -q, 1 + 1/n, (-b)*(x^n/a), (-d)*(x^n/c)], x] /; FreeQ[{a, b, c, d, n, p, q}, x] && NeQ[b*c - a*d, 0] && NeQ[n
, -1] && (IntegerQ[p] || GtQ[a, 0]) && (IntegerQ[q] || GtQ[c, 0])

Rule 441

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Dist[a^IntPart[p]*((a + b*x^n)^F
racPart[p]/(1 + b*(x^n/a))^FracPart[p]), Int[(1 + b*(x^n/a))^p*(c + d*x^n)^q, x], x] /; FreeQ[{a, b, c, d, n,
p, q}, x] && NeQ[b*c - a*d, 0] && NeQ[n, -1] &&  !(IntegerQ[p] || GtQ[a, 0])

Rule 1985

Int[(u_.)*((a_) + (b_.)/((c_) + (d_.)*(x_)^(n_)))^(p_), x_Symbol] :> Int[u*((b + a*c + a*d*x^n)/(c + d*x^n))^p
, x] /; FreeQ[{a, b, c, d, n, p}, x]

Rule 1986

Int[(u_.)*((e_.)*((a_.) + (b_.)*(x_)^(n_.))^(q_.)*((c_) + (d_.)*(x_)^(n_))^(r_.))^(p_), x_Symbol] :> Dist[Simp
[(e*(a + b*x^n)^q*(c + d*x^n)^r)^p/((a + b*x^n)^(p*q)*(c + d*x^n)^(p*r))], Int[u*(a + b*x^n)^(p*q)*(c + d*x^n)
^(p*r), x], x] /; FreeQ[{a, b, c, d, e, n, p, q, r}, x]

Rule 4233

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = Fr
eeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[(a + b/(1 - ff^2*x^2)^(n/2))^p/(1 - ff^2*x^2)^((m + 1)/2), x
], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n/2] &&  !IntegerQ
[p]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \left (a+\frac {b}{1-x^2}\right )^p \, dx,x,\sin (e+f x)\right )}{f} \\ & = \frac {\text {Subst}\left (\int \left (\frac {a+b-a x^2}{1-x^2}\right )^p \, dx,x,\sin (e+f x)\right )}{f} \\ & = \frac {\left (\cos ^2(e+f x)^p \left (a+b-a \sin ^2(e+f x)\right )^{-p} \left (\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )\right )^p\right ) \text {Subst}\left (\int \left (1-x^2\right )^{-p} \left (a+b-a x^2\right )^p \, dx,x,\sin (e+f x)\right )}{f} \\ & = \frac {\left (\cos ^2(e+f x)^p \left (\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )\right )^p \left (1-\frac {a \sin ^2(e+f x)}{a+b}\right )^{-p}\right ) \text {Subst}\left (\int \left (1-x^2\right )^{-p} \left (1-\frac {a x^2}{a+b}\right )^p \, dx,x,\sin (e+f x)\right )}{f} \\ & = \frac {\operatorname {AppellF1}\left (\frac {1}{2},p,-p,\frac {3}{2},\sin ^2(e+f x),\frac {a \sin ^2(e+f x)}{a+b}\right ) \cos ^2(e+f x)^p \sin (e+f x) \left (\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )\right )^p \left (1-\frac {a \sin ^2(e+f x)}{a+b}\right )^{-p}}{f} \\ \end{align*}

Mathematica [B] (warning: unable to verify)

Leaf count is larger than twice the leaf count of optimal. \(1983\) vs. \(2(101)=202\).

Time = 17.08 (sec) , antiderivative size = 1983, normalized size of antiderivative = 19.63 \[ \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=-\frac {3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) (a+2 b+a \cos (2 (e+f x)))^p \sec ^2(e+f x)^{-\frac {3}{2}+p} \left (a+b \sec ^2(e+f x)\right )^p \sin (e+f x)}{f \left (-3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+\left (-2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)\right ) \left (-\frac {3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) (a+2 b+a \cos (2 (e+f x)))^p \sec ^2(e+f x)^{-\frac {1}{2}+p}}{-3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+\left (-2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)}+\frac {6 a (a+b) p \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) (a+2 b+a \cos (2 (e+f x)))^{-1+p} \sec ^2(e+f x)^{-\frac {3}{2}+p} \sin (2 (e+f x)) \tan (e+f x)}{-3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+\left (-2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)}-\frac {6 (a+b) \left (-\frac {3}{2}+p\right ) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) (a+2 b+a \cos (2 (e+f x)))^p \sec ^2(e+f x)^{-\frac {3}{2}+p} \tan ^2(e+f x)}{-3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+\left (-2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)}-\frac {3 (a+b) (a+2 b+a \cos (2 (e+f x)))^p \sec ^2(e+f x)^{-\frac {3}{2}+p} \tan (e+f x) \left (\frac {2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)}{3 (a+b)}-\operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)\right )}{-3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+\left (-2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)}+\frac {3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) (a+2 b+a \cos (2 (e+f x)))^p \sec ^2(e+f x)^{-\frac {3}{2}+p} \tan (e+f x) \left (2 \left (-2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \sec ^2(e+f x) \tan (e+f x)-3 (a+b) \left (\frac {2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)}{3 (a+b)}-\operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)\right )+\tan ^2(e+f x) \left (-2 b p \left (-\frac {6 b (1-p) \operatorname {AppellF1}\left (\frac {5}{2},\frac {3}{2},2-p,\frac {7}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)}{5 (a+b)}-\frac {9}{5} \operatorname {AppellF1}\left (\frac {5}{2},\frac {5}{2},1-p,\frac {7}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)\right )+3 (a+b) \left (\frac {6 b p \operatorname {AppellF1}\left (\frac {5}{2},\frac {5}{2},1-p,\frac {7}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)}{5 (a+b)}-3 \operatorname {AppellF1}\left (\frac {5}{2},\frac {7}{2},-p,\frac {7}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)\right )\right )\right )}{\left (-3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},\frac {3}{2},-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+\left (-2 b p \operatorname {AppellF1}\left (\frac {3}{2},\frac {3}{2},1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},\frac {5}{2},-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)\right )^2}\right )} \]

[In]

Integrate[Cos[e + f*x]*(a + b*Sec[e + f*x]^2)^p,x]

[Out]

(-3*(a + b)*AppellF1[1/2, 3/2, -p, 3/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b))]*(a + 2*b + a*Cos[2*(e
+ f*x)])^p*(Sec[e + f*x]^2)^(-3/2 + p)*(a + b*Sec[e + f*x]^2)^p*Sin[e + f*x])/(f*(-3*(a + b)*AppellF1[1/2, 3/2
, -p, 3/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b))] + (-2*b*p*AppellF1[3/2, 3/2, 1 - p, 5/2, -Tan[e + f
*x]^2, -((b*Tan[e + f*x]^2)/(a + b))] + 3*(a + b)*AppellF1[3/2, 5/2, -p, 5/2, -Tan[e + f*x]^2, -((b*Tan[e + f*
x]^2)/(a + b))])*Tan[e + f*x]^2)*((-3*(a + b)*AppellF1[1/2, 3/2, -p, 3/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2
)/(a + b))]*(a + 2*b + a*Cos[2*(e + f*x)])^p*(Sec[e + f*x]^2)^(-1/2 + p))/(-3*(a + b)*AppellF1[1/2, 3/2, -p, 3
/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b))] + (-2*b*p*AppellF1[3/2, 3/2, 1 - p, 5/2, -Tan[e + f*x]^2,
-((b*Tan[e + f*x]^2)/(a + b))] + 3*(a + b)*AppellF1[3/2, 5/2, -p, 5/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(
a + b))])*Tan[e + f*x]^2) + (6*a*(a + b)*p*AppellF1[1/2, 3/2, -p, 3/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(
a + b))]*(a + 2*b + a*Cos[2*(e + f*x)])^(-1 + p)*(Sec[e + f*x]^2)^(-3/2 + p)*Sin[2*(e + f*x)]*Tan[e + f*x])/(-
3*(a + b)*AppellF1[1/2, 3/2, -p, 3/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b))] + (-2*b*p*AppellF1[3/2,
3/2, 1 - p, 5/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b))] + 3*(a + b)*AppellF1[3/2, 5/2, -p, 5/2, -Tan[
e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b))])*Tan[e + f*x]^2) - (6*(a + b)*(-3/2 + p)*AppellF1[1/2, 3/2, -p, 3/2
, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b))]*(a + 2*b + a*Cos[2*(e + f*x)])^p*(Sec[e + f*x]^2)^(-3/2 + p)
*Tan[e + f*x]^2)/(-3*(a + b)*AppellF1[1/2, 3/2, -p, 3/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b))] + (-2
*b*p*AppellF1[3/2, 3/2, 1 - p, 5/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b))] + 3*(a + b)*AppellF1[3/2,
5/2, -p, 5/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b))])*Tan[e + f*x]^2) - (3*(a + b)*(a + 2*b + a*Cos[2
*(e + f*x)])^p*(Sec[e + f*x]^2)^(-3/2 + p)*Tan[e + f*x]*((2*b*p*AppellF1[3/2, 3/2, 1 - p, 5/2, -Tan[e + f*x]^2
, -((b*Tan[e + f*x]^2)/(a + b))]*Sec[e + f*x]^2*Tan[e + f*x])/(3*(a + b)) - AppellF1[3/2, 5/2, -p, 5/2, -Tan[e
 + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b))]*Sec[e + f*x]^2*Tan[e + f*x]))/(-3*(a + b)*AppellF1[1/2, 3/2, -p, 3/2
, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b))] + (-2*b*p*AppellF1[3/2, 3/2, 1 - p, 5/2, -Tan[e + f*x]^2, -(
(b*Tan[e + f*x]^2)/(a + b))] + 3*(a + b)*AppellF1[3/2, 5/2, -p, 5/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a
+ b))])*Tan[e + f*x]^2) + (3*(a + b)*AppellF1[1/2, 3/2, -p, 3/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b)
)]*(a + 2*b + a*Cos[2*(e + f*x)])^p*(Sec[e + f*x]^2)^(-3/2 + p)*Tan[e + f*x]*(2*(-2*b*p*AppellF1[3/2, 3/2, 1 -
 p, 5/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b))] + 3*(a + b)*AppellF1[3/2, 5/2, -p, 5/2, -Tan[e + f*x]
^2, -((b*Tan[e + f*x]^2)/(a + b))])*Sec[e + f*x]^2*Tan[e + f*x] - 3*(a + b)*((2*b*p*AppellF1[3/2, 3/2, 1 - p,
5/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b))]*Sec[e + f*x]^2*Tan[e + f*x])/(3*(a + b)) - AppellF1[3/2,
5/2, -p, 5/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b))]*Sec[e + f*x]^2*Tan[e + f*x]) + Tan[e + f*x]^2*(-
2*b*p*((-6*b*(1 - p)*AppellF1[5/2, 3/2, 2 - p, 7/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b))]*Sec[e + f*
x]^2*Tan[e + f*x])/(5*(a + b)) - (9*AppellF1[5/2, 5/2, 1 - p, 7/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a +
b))]*Sec[e + f*x]^2*Tan[e + f*x])/5) + 3*(a + b)*((6*b*p*AppellF1[5/2, 5/2, 1 - p, 7/2, -Tan[e + f*x]^2, -((b*
Tan[e + f*x]^2)/(a + b))]*Sec[e + f*x]^2*Tan[e + f*x])/(5*(a + b)) - 3*AppellF1[5/2, 7/2, -p, 7/2, -Tan[e + f*
x]^2, -((b*Tan[e + f*x]^2)/(a + b))]*Sec[e + f*x]^2*Tan[e + f*x]))))/(-3*(a + b)*AppellF1[1/2, 3/2, -p, 3/2, -
Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b))] + (-2*b*p*AppellF1[3/2, 3/2, 1 - p, 5/2, -Tan[e + f*x]^2, -((b*
Tan[e + f*x]^2)/(a + b))] + 3*(a + b)*AppellF1[3/2, 5/2, -p, 5/2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/(a + b
))])*Tan[e + f*x]^2)^2))

Maple [F]

\[\int \cos \left (f x +e \right ) \left (a +b \sec \left (f x +e \right )^{2}\right )^{p}d x\]

[In]

int(cos(f*x+e)*(a+b*sec(f*x+e)^2)^p,x)

[Out]

int(cos(f*x+e)*(a+b*sec(f*x+e)^2)^p,x)

Fricas [F]

\[ \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int { {\left (b \sec \left (f x + e\right )^{2} + a\right )}^{p} \cos \left (f x + e\right ) \,d x } \]

[In]

integrate(cos(f*x+e)*(a+b*sec(f*x+e)^2)^p,x, algorithm="fricas")

[Out]

integral((b*sec(f*x + e)^2 + a)^p*cos(f*x + e), x)

Sympy [F]

\[ \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int \left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{p} \cos {\left (e + f x \right )}\, dx \]

[In]

integrate(cos(f*x+e)*(a+b*sec(f*x+e)**2)**p,x)

[Out]

Integral((a + b*sec(e + f*x)**2)**p*cos(e + f*x), x)

Maxima [F]

\[ \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int { {\left (b \sec \left (f x + e\right )^{2} + a\right )}^{p} \cos \left (f x + e\right ) \,d x } \]

[In]

integrate(cos(f*x+e)*(a+b*sec(f*x+e)^2)^p,x, algorithm="maxima")

[Out]

integrate((b*sec(f*x + e)^2 + a)^p*cos(f*x + e), x)

Giac [F]

\[ \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int { {\left (b \sec \left (f x + e\right )^{2} + a\right )}^{p} \cos \left (f x + e\right ) \,d x } \]

[In]

integrate(cos(f*x+e)*(a+b*sec(f*x+e)^2)^p,x, algorithm="giac")

[Out]

integrate((b*sec(f*x + e)^2 + a)^p*cos(f*x + e), x)

Mupad [F(-1)]

Timed out. \[ \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int \cos \left (e+f\,x\right )\,{\left (a+\frac {b}{{\cos \left (e+f\,x\right )}^2}\right )}^p \,d x \]

[In]

int(cos(e + f*x)*(a + b/cos(e + f*x)^2)^p,x)

[Out]

int(cos(e + f*x)*(a + b/cos(e + f*x)^2)^p, x)